package com.jspgou.core.manager.impl;

import org.springframework.beans.factory.annotation.Autowired;

import com.jspgou.common.hibernate3.Updater;
import com.jspgou.common.page.Pagination;
import com.jspgou.core.dao.ZoneDao;
import com.jspgou.core.entity.Zone;
import com.jspgou.core.manager.ZoneMng;

public class ZoneMngImpl implements ZoneMng{

    public Pagination getAllPage(int pageNo, int pageSize){
        return dao.getAllPage(pageNo, pageSize);
    }

    public Zone findById(Long id){
        return dao.findById(id);
    }

    public Zone save(Zone bean){
        return dao.save(bean);
    }

    public Zone update(Zone bean){
        return dao.updateByUpdater(new Updater<Zone>(bean));
    }

    public Zone deleteById(Long id){
        return dao.deleteById(id);
    }

    public Zone[] deleteByIds(Long[] ids){
        Zone beans[] = new Zone[ids.length];
        for(int i = 0; i < ids.length; i++){
        	beans[i] = deleteById(ids[i]);
        }
        return beans;
    }

    private ZoneDao dao;
    
	@Autowired
    public void setDao(ZoneDao dao){
        this.dao = dao;
    }
}
